﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Circle circle = new Circle();
            Triangle triangle = new Triangle();
            Trapezoid trapezoid = new Trapezoid();

            if (radioButton1.Checked)
            {
                circle.SetRadius(double.Parse(textBox1.Text));

                textBox7.Text = Convert.ToString(circle.Area());
            }

            if (radioButton2.Checked)
            {
                triangle.SetBottom(double.Parse(textBox2.Text));
                triangle.SetHeight(double.Parse(textBox3.Text));

                textBox7.Text = Convert.ToString(triangle.Area());
            }

            if (radioButton3.Checked)
            {
                trapezoid.SetTopBottom(double.Parse(textBox4.Text));
                trapezoid.SetBelowBottom(double.Parse(textBox5.Text));
                trapezoid.SetHeight(double.Parse(textBox6.Text));

                textBox7.Text = Convert.ToString(trapezoid.Area());
            }
        }
    }
}
